<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta content="text/html;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
	<meta http-equiv ="Pragma" content = "no-cache"/>
	<meta http-equiv="Cache-Control" content="no cache" />
	<meta http-equiv="Expires" content="0" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
	<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<meta name="format-detection" content="telephone=no"/>
	<script src="https://cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
	<link href="https://cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
	<link rel="stylesheet" type="text/css" href="../../plugins/layui/css/layui.css" media="all"/>
	<link rel="stylesheet" type="text/css" href="../../plugins/layui/css/layui.css" media="all"/>
	<link rel="stylesheet" type="text/css" href="../../css/fs.css" media="all"/>
	<script type="text/javascript" src="../../plugins/jquery/jquery.min.js"></script>
	<script type="text/javascript" src="../../plugins/layui/layui.js"></script>

	<script src="https://cdn.bootcss.com/layer/2.3/layer.js"></script>

	<script type="text/javascript" src="../../plugins/home/common.js"></script>
	<script type="text/javascript" src="../../scripts/home/magerIndcInfo.js"></script>
	<script type="text/javascript" src="../../plugins/frame/js/fsDict.js"></script>
	<script type="text/javascript" src="../../plugins/frame/js/fs.js"></script>
	<script type="text/javascript" src="../../plugins/frame/js/frame.js"></script>
	<style>
		.laytable-cell-1-11 {
			width: 230px;
			text-align: left;
		}
	</style>
</head>
<body>
<div >
	<div class="layui-fluid">
		<div class="layui-row layui-col-space1">
			<div class="layui-col-md12">
				<div class="layui-form-query">
					<form class="layui-form" id="query_form">
						<div class="layui-form-item">
							<div class="layui-inline">
								<label class="layui-form-mid">合同签署日期：</label>
								<div class="layui-input-inline" style="width: 200px;">
									<input type="text" class="layui-input" name="createDate" id="createDate"  placeholder='请输入合同签署日期'>
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-mid">产品名称：</label>
								<div class="layui-input-inline" style="width: 130px;">
									<input type="text" name="cFundname" autocomplete="off" class="layui-input" placeholder='请输入产品名称' />
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-mid">合同编号：</label>
								<div class="layui-input-inline" style="width: 200px;text-align:left">
									<input type="text" name="contractNum" autocomplete="off" class="layui-input" placeholder='请输入合同编号' />
								</div>
							</div>
							<div class="layui-inline">
								<label class="layui-form-mid">客户名称：</label>
								<div class="layui-input-inline" style="width: 130px;">
									<input type="text" name="cCustname" autocomplete="off" class="layui-input" placeholder='请输入客户名称' />
								</div>
							</div>

							<div class="layui-inline">
								<div class="layui-input-inline">
									<button class="layui-btn" type="button" function="query"><i class="layui-icon">&#xe615;</i>查询</button>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
			<div class="layui-col-md12">
				<div class="layui-row grid-demo">
					<div class="layui-col-md12" style="display: none">
						<button class="layui-btn" function="top" topUrl="add.html" topWidth="600px" isMaximize="0" topHeight="400px" topTitle="新增">
							<i class="layui-icon">&#xe654;</i>新增
						</button>
						<button class="layui-btn layui-btn-danger" function="submit" url="/heTongSignManager/delete.shtml" isMutiDml="1" isConfirm="1" confirmMsg="是否确定删除选中的数据？" inputs="contractId:">
							<i class="layui-icon">&#xe640;</i>批量删除
						</button>
						<button class="layui-btn" function="refresh">
							<i class="layui-icon">&#x1002;</i>刷新
						</button>
						<!--<button class="layui-btn" function="kfapp">
							<i class="layui-icon">&#xe756;</i>测试
						</button>-->
					</div>
					<div class="layui-col-md12">
						<table id="fsDatagrid" lay-filter="fsDatagrid" class="fsDatagrid" isLoad="1" url="/heTongSignManager/findAllListPage.shtml" isPage="1" sortType="1" defaultForm="query_form" height="full-135"></table>

						<div class="fsDatagridCols">
							<p type="numbers" title="序号"  fixed="left"/>
							<!--<p checkbox="false"/>-->
							<p field="contractNum" title="合同编号" width="260" sort="true" fixed="left" />
							<p field="createDate" title="合同签署日期" width="160" sort="true"/>
							<p field="contractSts" title="合同状态" width="160" sort="true"/>
						<!--	<p field="contractStsCode" title="合同状态" width="100" sort="true"/>-->
							<p field="cCustname" title="客户名称" width="160" sort="true"/>
							<p field="cBrokername" title="理财师名称" width="120" sort="true"/>
							<p field="cFundname" title="产品名称" width="160" sort="true"/>
							<p field="fBalance" title="产品金额" width="120" sort="true"/>
							<p field="bankName" title="银行名称" width="260" sort="true"/>
							<p field="nameinbank" title="受益人名称" width="160" sort="true"/>
							<p field="acctNo" title="受益账号" width="260" sort="true"/>
							<p fixed="right" align="center" width="231" toolbar="#barDemo" title="操作"/>
						</div>
						<script type="text/html" id="barDemo">
							<a class="layui-btn  layui-btn-xs" lay-event="signLog"   topTitle="签署日志" inputs="contractId:">签署日志</a>
							<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="lookHeTong"    topTitle="查看合同" inputs="contractId:">查看合同</a>
							{{# if(d.contractStsCode=='3' ||d.contractStsCode=='4'||d.contractStsCode=='5'||d.contractStsCode=='6'){}}
							<a class="layui-btn layui-btn-xs layui-btn-danger"  lay-event="contractCancel"  topTitle="合同作废" inputs="contractId:">合同作废</a>
							{{#}}}
						</script>
						<script type="text/html" id="column2Tpl">
							{{# if(d.userType=='PERSONAL'){}}
							<span style="color: #5FB878">个人用户</span>
							{{#} else if(d.userType=='INSTITUTION'){}}
							<span style="color: #5FB878"> 企业</span>
							{{#} else if(d.userType=='INVESTMENT_MANAGER'){}}
							<span style="color: #5FB878"> 客户经理</span>
							{{#} else if(d.userType=='FAMILY'){}}
							<span style="color: #5FB878"> 家庭</span>
							{{#} else {}}
							<span style="color: #5FB878"> </span>
							{{#}}}
						</script>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
    var domain=getDomain();
    layui.fsButton.signLog = function(elem,data,datagrid){
		var contractId=data.contractId;
        if(''==contractId||null==contractId){
            messageInfo("暂无合同信息");
            return;
        }else{
            var index = layer.open({
                type: 2,
                title: "签署日志",
                id:(new Date()).valueOf(),
                maxmin: true,
                area: ['800px', '600px'],//宽高不影响最大化
                content: '../constractSignLog/index.html?contractId='+contractId,//地址
                success: function (layero, index) {

                },
                end: function () {

                }
            });
            layer.full(index);
        }
    }
    layui.fsButton.contractCancel = function(elem,data,datagrid){
        //alert(JSON.stringify(data));
		var contractId=data.contractId;
		var contractSts=data.contractStsCode;
		var reserveNo=data.cReserveno;
		var contractNum=data.contractNum;
		if(''==contractId||null==contractId){
            messageInfo("暂无合同信息");
            return;
		}else{
            var index = layer.open({
                type: 2,
                title: "合同作废",
                id:(new Date()).valueOf(),
                maxmin: true,
                area: ['800px', '600px'],//宽高不影响最大化
                content: '../constractCancel/index.html?contractId='+contractId+"&contractSts="+contractSts
                    +"&reserveNo="+reserveNo+"&contractNum="+contractNum,//地址
                success: function (layero, index) {

                },
                end: function () {

                }
            });
            layer.full(index);
		}
    }
    layui.fsButton.lookHeTong = function(elem,data,datagrid){
		var contractId=data.contractId;
		if(''==contractId||null==contractId){
		    messageInfo("暂无合同信息");
		    return;
		}else{
            $.ajax({
                url: domain+"/api/v2/yunhetong/download/contract", //请求的url地址
                dataType: "json", //返回格式为json
                async: true, //请求是否异步，默认为异步，这也是ajax重要特性
                data: {
                    "idType": "0",
                    "idContent":contractId
                }, //参数值
                type: "post", //请求方式
                beforeSend: function() {
                    //请求前的处理
                },
                success: function(req) {
                    //请求成功时处理
                    openDialog('合同下载',req.data)

                },
                complete: function() {
                    //请求完成的处理
                },
                error: function() {
                    //请求出错处理
                }
            });
		}

    }
function openDialog(title,url){
    var index = layer.open({
        type: 2,
        title: title,
        id:(new Date()).valueOf(),
        maxmin: true,
        area: ['800px', '600px'],//宽高不影响最大化
        content: url,//地址
        success: function (layero, index) {

        },
        end: function () {

        }
    });
    layer.full(index);
}
</script>
<script type="text/javascript">
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#createDate'
			,range: true
        });
    });
</script>
</body>
</html>
